package com.mobile.web.control;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.mobile.common.base.support.Page;
import com.mobile.common.base.web.BaseController;
import com.mobile.handler.UsersHandler;
import com.mobile.persistent.entity.Users;

@Controller
@Scope("prototype")
@RequestMapping("/user")
public class UserController extends BaseController {
	
	@Resource UsersHandler usersHandler;
	
	@RequestMapping(params = "action=index")
	public ModelAndView index(
            final HttpServletRequest request,
            final HttpServletResponse response){
		Map<String, Object> model = new HashMap<String,Object>();
		Page<Users> userPage = usersHandler.findPageByCriteria(null, 1, 1);
		model.put("page", userPage);
		return new ModelAndView("/users/user.jsp", model);
	}

	
}
